home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS 8
/
P8A004.dsk
/
FILECAB.MOD.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
5KB
|
147 lines
10 REM **FILE CABINET MODIFIER**
20 REM WRITTEN BY
30 REM MICHAEL MOORE
40 :
50 REM JUNE 1984
60 TEXT : HOME : CLEAR
62 TEXT : HOME : VTAB 5
64 HTAB 10: PRINT "FILECABINET MODIFIER"
66 HTAB 10: PRINT " BY MICHAEL MOORE": PRINT
70 GOSUB 2010: REM SETUP INPUT ANYTHING
75 VTAB 8: PRINT "DISPLAY INSTRUCTIONS ? (Y/N) ";: GET A$
76 PRINT A$
78 IF LEFT$(A$,1) = "Y" THEN GOSUB 3010
80 VTAB 12: PRINT "INSERT FILE CABINET DISK - PRESS A KEY";: GET A$: PRINT
90 D$ = CHR$(4)
100 PRINT D$;"PREFIX"
110 INPUT PX$: REM OBTAIN CURRENT DISK PATH
120 DIM HD$(20),BN$(40)
130 ONERR GOTO 1950
135 PRINT D$;"VERIFY";PX$ +"BASENAMES"
140 PRINT D$;"OPEN";PX$ +"BASENAMES"
145 PRINT D$;"READ";PX$ +"BASENAMES"
150 INPUT NB$:NB = VAL(NB$)
160 FOR N = 1 TO NB: CALL 768,BN$(N): NEXT N
170 PRINT D$;"CLOSE"
180 POKE 216,0
200 REM << DISPLAY DATA BASE NAMES >>
210 HOME : VTAB 5
220 PRINT "DATA BASE NAMES ON FILE----": PRINT
230 FOR N = 1 TO NB
240 PRINT N;" ";BN$(N)
250 NEXT N
260 PRINT : PRINT "ENTER NUMBER OF DATA BASE TO BE MODIFIED... ";: GET K$: PRINT K$
265 DB = VAL(K$)
270 ONERR GOTO 1950
280 Q$ = PX$ +BN$(DB) +"/" +"HEADER"
290 PRINT D$;"VERIFY";Q$
300 PRINT D$;"OPEN";Q$
310 PRINT D$;"READ";Q$
320 INPUT NH
330 FOR N = 1 TO NH
340 CALL 768,HD$(N)
350 NEXT N
360 PRINT D$;"CLOSE"
365 POKE 216,0
370 HOME : VTAB 5
380 PRINT "HEADERS ON FILE ---": PRINT
390 FOR N = 1 TO NH
400 PRINT N;" ";HD$(N)
410 NEXT N
420 PRINT : PRINT "TO CHANGE A HEADER, ENTER THE NUMBER OF THE HEADER TO BE MODIFIED.": PRINT
430 PRINT "TO ADD A NEW HEADER, ENTER A NUMBER GREATER THAN THE LAST SHOWN HEADER NUMBER.": PRINT
440 PRINT "PRESS 'RETURN' TO END MODIFICATIONS."
445 PRINT SPC( 10);"ENTER CHOICE : ";
450 GET K$:K = VAL(K$): PRINT K$
460 IF K = 0 AND ADDER = 0 AND CHANGE$ < >"YES" GOTO 1910
470 IF K = 0 AND ADDER >0 OR CHANGE$ = "YES" GOTO 810: REM WRITE NEW HEADER
480 IF K >N -1 GOTO 610
490 IF K <0 GOTO 370
500 REM << CHANGE HEADER >>
510 HOME : VTAB 5
520 PRINT "ORIGINAL HEADER NAME : ";HD$(K): PRINT
530 PRINT "TO MAKE NO CHANGE, PRESS 'RETURN": PRINT : PRINT
540 INPUT "ENTER REVISED HEADER NAME : ";H$
550 IF LEN(H$) = 0 GOTO 370
555 CHANGE$ = "YES"
560 HD$(K) = H$
570 GOTO 370
600 REM << ADD HEADER >>
610 NH = NH +1
620 HD$(NH) = "*MISC*"
630 ADDER = ADDER +1: REM FLAG TO INDICATE NUMBER OF ADDED HEADERS
640 GOTO 370
800 REM << WRITE NEW HEADER >>
810 Q$ = PX$ +BN$(DB) +"/" +"HEADER"
820 PRINT D$;"OPEN";Q$
830 PRINT D$;"WRITE";Q$
840 PRINT NH
850 FOR N = 1 TO NH
860 PRINT HD$(N)
870 NEXT N
880 PRINT D$;"CLOSE"
890 IF ADDER >0 GOTO 1010: REM NEED TO CHANGE INDEX
900 REM << MODIFY MORE FILES >>
910 PRINT : INPUT "MODIFY MORE FILES (Y/N) ? ";YN$:YN$ = LEFT$(YN$,1): IF YN$ < >"Y" AND YN$ < >"N" GOTO 910
920 IF YN$ = "N" GOTO 1910
930 GOTO 60
1000 REM << CHANGE INDEX >>
1010 Q$ = PX$ +BN$(DB) +"/" +"INDEX"
1020 PRINT D$;"OPEN";Q$
1030 PRINT D$;"READ";Q$
1040 INPUT NR
1050 FOR I = 1 TO NR
1055 FOR J = 1 TO NH -ADDER
1060 CALL 768,DX$(I,J)
1065 NEXT J
1070 NEXT I
1080 PRINT D$;"CLOSE"
1100 REM << WRITE REVISED INDEX >>
1110 PRINT D$;"OPEN";Q$
1120 PRINT D$;"WRITE";Q$
1130 PRINT NR
1140 FOR I = 1 TO NR
1145 FOR J = 1 TO NH -ADDER
1150 PRINT DX$(I,J)
1160 NEXT J
1170 FOR L = 1 TO ADDER
1180 PRINT CHR$(32)
1190 NEXT L
1200 NEXT I
1210 PRINT D$;"CLOSE"
1500 REM << MODIFY MORE FILES >>
1510 PRINT : INPUT "MODIFY MORE FILES (Y/N) ? ";YN$:YN$ = LEFT$(YN$,1): IF YN$ < >"Y" AND YN$ < >"N" GOTO 1510
1520 IF YN$ = "N" GOTO 1910
1530 GOTO 60: REM RETURN TO START
1900 REM << TERMINATION MESSAGES >>
1910 HOME : PRINT "ENTER 'RUN' TO RESTART....": END
1950 HOME : PRINT "PROGRAM ABORT DUE TO FILE ERROR..... CHECK FOR PROPER DISK AND FILES AND RETRY.": END
2000 REM << INPUT ANYTHING >>
2010 FOR X = 1 TO 71: READ X%: POKE 768 +X -1,X%: NEXT X: RESTORE : RETURN
2020 DATA 32,190,222,32,227,223,36,17,208,5,162,0,76,15,3,133,133,132,134,165
2030 DATA 184,164,185,133,135,132,136,32,44,213,173,0,2,201,3,208,3,76,99,216
2040 DATA 169,0,133,13,133,14,169,0,160,2,32,237,227,32,61,231,32,123,218,165
2050 DATA 135,164,136,133,184,132,185,32,183,0,96,0,0,0,0,0,0,0,0,0
3000 REM << INSTRUCTIONS >>
3010 TEXT : HOME : VTAB 5
3020 HTAB 10: PRINT "FILECABINET MODIFIER"
3030 HTAB 10: PRINT " BY MICHAEL MOORE": PRINT
3035 POKE 34,7: REM SET TOP WINDOW
3040 PRINT "THIS PROGRAM PERMITS THE ADDITION OF HEADERS TO FILES CREATED BY THE PRODOS VERSIONS OF 'FILECABINET'.": PRINT
3050 PRINT "BLANK DATA FIELDS ARE ADDED FOR EACH CORRESPONDING HEADER.": PRINT
3060 PRINT "A DUMMY HEADER NAME OF *MISC* IS PROVIDED FOR EACH ADDITION. THESE CAN BE CHANGED USING THE HEADER CHANGE FEATURE OF THIS PROGRAM.": PRINT
3070 GOSUB 4910: HOME
3080 PRINT "HEADERS CAN BE CHANGED BY ENTERING THE NUMBER CORRESPONDING TO THE HEADER TO BE REVISED. ": PRINT
3090 PRINT "ENTRY OF HEADER NAMES SHOULD CONFORM TO FILE CABINET LENGTH RESTRICTIONS OF 15 CHARACTERS MAXIMUM.": PRINT
3100 GOSUB 4910: HOME
3110 TEXT : RETURN
4900 REM << CONTINUE REQUEST >>
4910 PRINT "PRESS ANY KEY TO CONTINUE";: GET K$
4920 RETURN
5000 REM **********************
5010 REM FILE CABINET MODIFIER
5020 REM BY MICHAEL MOORE
5030 REM 6/30/84
5040 REM
5050 REM **********************
5060 REM APPLE CORPS OF DALLAS